package com.weijin.springbootbase.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/11 14:34
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("分页结果类")
public class PageResult<T> {
    @ApiModelProperty("页码")
    private Integer pageNum;
    @ApiModelProperty("每页记录数")
    private Integer pageSize;
    @ApiModelProperty("总记录数")
    private Long total;
    @ApiModelProperty("总页数")
    private int totalPage;
    @ApiModelProperty("响应数据")
    private List<T> list;

    public <T> PageResult(Integer pageNum, Integer pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

}
